package Scaner;

import android.content.Context;

import Scaner.rfid.RfidScan;
import Scaner.rfid.TimerRfidScaner;
import Scaner.scan.Scaner;
import Scaner.scan.TimerInfraraedScaner;

/**
 * 红外扫描器工厂
 * Created by zhengjinglan on 2018/5/27.
 */

public class InfraredScanerFactory implements IScanerFactory {

    private static Scaner infraredScaner;
    private static RfidScan rfidScan;
    private static Context context;


    public InfraredScanerFactory(Context context) {
        this.context=context;
    }

    @Override
    public Scaner createScaner() {
        if(infraredScaner==null){
            infraredScaner = new TimerInfraraedScaner(context);
        }
        return infraredScaner;
    }

    @Override
    public RfidScan createRfid() {
        if (rfidScan == null){
            rfidScan = new TimerRfidScaner(context);
        }
        return rfidScan;
    }


}
